import request from '@/utils/request'

export default {

  // 分页查询
  findPage: params => request('/api/ucenter/menu/page', {
    method: 'get',
    params,
  }),

  // 查询列表
  findList: params => request('/api/ucenter/menu/list', {
    method: 'get',
    params,
  }),

  // 查询列表（返回树）
  findTree: () => request('/api/ucenter/menu/tree', {
    method: 'get',
  }),

  // 添加
  add: data => request('/api/ucenter/menu', {
    method: 'post',
    data,
  }),

  // 编辑
  edit: (id, data) => request(`/api/ucenter/menu/${id}`, {
    method: 'put',
    data,
  }),

  // 删除
  remove: id => request(`/api/ucenter/menu/${id}`, {
    method: 'delete',
  }),
}
